package cn.glc.daily.life.model.dto;

import cn.simon.free.validator.annotation.MobileOrEmailValid;
import cn.simon.free.validator.annotation.PasswordValid;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 用户手机号/邮箱注册
 *
 * @author simon
 * @date 2020/9/24 15:53
 * @copyright:
 * @modifier
 * @motto a no talent, people who have to study hard
 */
@Data
public class UserSignupDto implements Serializable {

    private static final long serialVersionUID = 5432277730628434691L;
    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "昵称", example = "长大后可怂了丶")
    @NotBlank(message = "请输入一个昵称")
    private String nickName;
    /**
     * 用户账号 手机号 邮箱账号
     */
    @ApiModelProperty(value = "账号", example = "账号")
    @NotBlank(message = "请输入手机号或者邮箱账号")
    @MobileOrEmailValid(message = "请输入正确的手机或者邮箱号码")
    private String identify;
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", example = "密码")
    @NotBlank(message = "请输入密码")
    @PasswordValid(message = "密码同时包含大小写字母和特殊字符")
    private String credential;
    /**
     * 接收的手机/邮箱验证码
     */
    @ApiModelProperty(value = "验证码", example = "验证码")
    @NotBlank(message = "验证码")
    private String code;
    /**
     * 注册的类型（手机号、邮箱）
     */
    @ApiModelProperty(value = "注册类型", example = "手机号/邮箱")
    @NotBlank(message = "注册类型不能为空")
    private String type;
}
